﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smartec.Accounts.Camel.AMS.Model.Entities;

namespace Smartec.Accounts.Camel.AMS.Model.Repository
{
//    class DBAuditRepository
//    {
//    }
//}
    internal static class LightWordRepository
    {

        internal static void AddLigthWord(LightWord LightWord)
        {
            AMSObjectContextHelper.CurrentObjectContext.LightWords.AddObject(LightWord);
        }
        internal static void Save()
        {
            AMSObjectContextHelper.CurrentObjectContext.SaveChanges();
        }

        internal static List<LightWord> All()
        {
            return AMSObjectContextHelper.CurrentObjectContext.LightWords.ToList();
        }

        internal static void DeleteLightWordById(int id)
        {
            var LightWord = AMSObjectContextHelper.CurrentObjectContext.LightWords.FirstOrDefault(t => t.ID == id);
            if (LightWord != null)
            {
                AMSObjectContextHelper.CurrentObjectContext.LightWords.DeleteObject(LightWord);
            }
        }
    }
}
